/**
 * ganjn
 */
var myPublicFun = {
    jqueryScroll:function(id){
        $("html,body").stop(true);
        $("html,body").animate({
            scrollTop: $("#"+id).offset().top
        },1000);
    },
    jqueryShowLoading:function(obj,options){
        var opts = {
            lines: 13, // The number of lines to draw
            length: 20, // The length of each line
            width: 8, // The line thickness
            radius: 45, // The radius of the inner circle
            scale: 0.45, // Scales overall size of the spinner
            //corners: 1, // Corner roundness (0..1)
            color: '#ffffff', // CSS color or array of colors
            fadeColor: 'transparent', // CSS color or array of colors
            opacity: 0.45, // Opacity of the lines
            rotate: 43, // The rotation offset
            direction: 1, // 1: clockwise, -1: counterclockwise
            speed: 0.8, // Rounds per second
            trail: 27, // Afterglow percentage
            fps: 20, // Frames per second when using setTimeout() as a fallback in IE 9
            zIndex: 2e9, // The z-index (defaults to 2000000000)
            className: 'spinner', // The CSS class to assign to the spinner
            top: '53%', // Top position relative to parent
            left: '52%', // Left position relative to parent
            //shadow: 'none', // Box-shadow for the lines
            position: 'absolute' // Element positioning
        };

        var options = $.extend(true,{},opts,options);
        $(obj).spin(options) ;
    },
    jqueryHideLoading:function(obj){
        $(obj).spin(false);
    },
    // echarts formatter 设置圆点
    getTooltipMarker: function(color, extraCssText){
        return color
        ? '<span style="display:inline-block;margin-right:5px;'
            + 'border-radius:10px;width:9px;height:9px;background-color:'
            + this.encodeHTML(color) + ';' + (extraCssText || '') + '"></span>'
        : '';
    },
    // encode HTML
    encodeHTML: function(source){
         return String(source)
            .replace(/&/g, '&amp;')
            .replace(/</g, '&lt;')
            .replace(/>/g, '&gt;')
            .replace(/"/g, '&quot;')
            .replace(/'/g, '&#39;');
    }
};
